using System;
using System.Collections;
using System.Web.UI;

namespace PS.WebParts.Rollup.CalendarWebPart
{
    public class CalendarDataSource : IDataSource
    {
        private int calendarType = 1;
        public int CalendarType
        {
            get { return calendarType; }
            set { calendarType = value; }
        }

        private string startDateField;
        public string StartDateField
        {
            get { return startDateField; }
            set { startDateField = value; }
        }

        private string endDateField;
        public string EndDateField
        {
            get { return endDateField; }
            set { endDateField = value; }
        }

        private string titleField;
        public string TitleField
        {
            get { return titleField; }
            set { titleField = value; }
        }

        private string allDayEventField;
        public string AllDayEventField
        {
            get { return allDayEventField; }
            set { allDayEventField = value; }
        }

        private string itemIdField;
        public string ItemIdField
        {
            get { return itemIdField; }
            set { itemIdField = value; }
        }

        private string descField;
        public string DescField
        {
            get { return descField; }
            set { descField = value; }
        }

        private string locationField;
        public string LocationField
        {
            get { return locationField; }
            set { locationField = value; }
        }

        private string recurrenceField;
        public string RecurrenceField
        {
            get { return recurrenceField; }
            set { recurrenceField = value; }
        }

        private string recurrenceExcField;
        public string RecurrenceExcField
        {
            get { return recurrenceExcField; }
            set { recurrenceExcField = value; }
        }

        private string workspaceLinkField;
        public string WorkspaceLinkField
        {
            get { return workspaceLinkField; }
            set { workspaceLinkField = value; }
        }

        private string dispFormUrlField;
        public string DispFormUrlField
        {
            get { return dispFormUrlField; }
            set { dispFormUrlField = value; }
        }

        private string direction;
        public string Direction
        {
            get { return direction; }
            set { direction = value; }
        } 
        
        IDataSource dataSource;

        public IDataSource DataSource
        {
            get { return dataSource; }
            set { dataSource = value; }
        }

        public CalendarDataSource(IDataSource data)
        {
            dataSource = data;
        }

        #region IDataSource Members

        public event EventHandler DataSourceChanged;

        public DataSourceView GetView(string viewName)
        {
            CalendarView view = new CalendarView(this, viewName);
            return view;
        }

        public System.Collections.ICollection GetViewNames()
        {
            ArrayList list = new ArrayList(1);
            list.Add(string.Empty);
            return list;
        }

        #endregion
    }
}
